<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>半圆旋转效果2</title>
    <style>
        .pink {
            width: 300px;
            height: 300px;
            border-radius: 50%;
            border: #000 1px solid;
        }
        
        .pink {
            position: relative;
            background-color: #000;
            overflow: hidden;
        }
        
        .blue {
            position: absolute;
            left: 50%;
            width: 50%;
            height: 100%;
            background-color: #fff;
            transform-origin: left center;
            transition: all 1s;
        }
        
        .imgBox {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 85%;
            height: 85%;
            border-radius: 50%;
            background-color: #fff;
            border: #000 1px solid;
            /* background: url("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fp7.itc.cn%2Fq_70%2Fimages03%2F20210104%2F37ab1f44400f4612a8cfff2b0c274a61.gif&refer=http%3A%2F%2Fp7.itc.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1669279262&t=acebf189d9badf09115a6fe8e130e227") no-repeat top / cover; */
        }
        
        .pink:hover {
            background: #000;
        }
        
        .pink:hover .blue {
            transform: rotate(720deg);
            background-color: white
        }
        
        .wrap {
            width: 300px;
            height: 300px;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-top: -150px;
            margin-left: -150px;
            transform-style: preserve-3d;
            transform: rotateX(45deg) rotateY(45deg);
            display: flex;
            flex-wrap: wrap;
            transition: all 1s ease-in-out;
        }
        
        .wrap:hover {
            transform: rotateX(720deg) rotateY(360deg);
        }
        
        .dice {
            box-sizing: border-box;
            position: absolute;
            top: 50%;
            left: 50%;
            margin-left: -50px;
            margin-top: -50px;
            width: 100px;
            height: 100px;
            border: 2px solid #000;
            background-color: #fff;
            border-radius: 5px;
            display: flex;
            padding: 10px;
        }
        
        .dot {
            width: 20px;
            height: 20px;
            background-color: #000;
            border-radius: 50%;
        }
        
        .one {
            transform: translateZ(50px);
            justify-content: center;
            align-items: center;
        }
        
        .two {
            transform: translateZ(-50px);
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
        }
        
        .three {
            transform: rotateY(90deg) translateZ(-50px);
            justify-content: space-around;
            align-items: center;
        }
        
        .three .dot:first-child {
            align-self: flex-start;
        }
        
        .three .dot:last-child {
            align-self: flex-end;
        }
        
        .four {
            transform: rotateY(90deg) translateZ(50px);
            flex-direction: column;
            justify-content: space-between;
        }
        
        .row {
            display: flex;
            justify-content: space-between;
        }
        
        .five {
            transform: rotateX(90deg) translateZ(50px);
            flex-direction: column;
            justify-content: space-between;
        }
        
        .five .row:nth-child(2) {
            display: flex;
            justify-content: center;
        }
        
        .six {
            transform: rotateX(90deg) translateZ(-50px);
            flex-direction: column;
            justify-content: space-between;
        }
    </style>

</head>

<body>
    <div class="pink">
        <div class="blue"></div>
        <div class="imgBox">
            <div class="wrap">
                <!-- 1 -->
                <div class="dice one">
                    <div class="dot"></div>
                </div>
                <!-- 2 -->
                <div class="dice two">
                    <div class="dot"></div>
                    <div class="dot"></div>
                </div>
                <!-- 3 -->
                <div class="dice three">
                    <div class="dot"></div>
                    <div class="dot"></div>
                    <div class="dot"></div>
                </div>

                <!-- 4 -->
                <div class="dice four">
                    <div class="row">
                        <div class="dot"></div>
                        <div class="dot"></div>
                    </div>
                    <div class="row">
                        <div class="dot"></div>
                        <div class="dot"></div>
                    </div>
                </div>

                <!-- 5 -->
                <div class="dice five">
                    <div class="row">
                        <div class="dot"></div>
                        <div class="dot"></div>
                    </div>
                    <div class="row">
                        <div class="dot"></div>
                    </div>
                    <div class="row">
                        <div class="dot"></div>
                        <div class="dot"></div>
                    </div>

                </div>
                <!-- 6 -->
                <div class="dice six">
                    <div class="row">
                        <div class="dot"></div>
                        <div class="dot"></div>
                        <div class="dot"></div>
                    </div>
                    <div class="row">
                        <div class="dot"></div>
                        <div class="dot"></div>
                        <div class="dot"></div>
                    </div>

                </div>
            </div>
        </div>
</body>

</html>